import { defHttp } from "@/utils/http";
import { baseUrlApi } from "./utils";

export type DetailResult = {
  code: number;
  data: any;
  msg: string;
};

/** 生产退料申请单列表带分页 */
export const getProduceRefundPageList = (data?: object) => {
  return defHttp.post<DetailResult>({
    url: baseUrlApi("/produce/refund/pagelist"),
    data
  });
};

/** 查询生产退料申请单详情 */
export const getProduceRefundDetail = (data?: object) => {
  return defHttp.post<DetailResult>({
    url: baseUrlApi("/produce/refund/detail"),
    data
  });
};

/** 获取生产退料可申请明细  */
export const getProduceRefundAvailableItems = (data?: object) => {
  return defHttp.post<DetailResult>({
    url: baseUrlApi("/produce/refund/availableRefundItems"),
    data
  });
};

/** 新增生产退料单 */
export const produceRefundAdd = (data?: object) => {
  return defHttp.post<DetailResult>({
    url: baseUrlApi("/produce/refund/add"),
    data
  });
};
